#-----------------------------------------------------------------------------
#
# DICOMConfig.cmake - cmake configuration file for external projects.
#
#-----------------------------------------------------------------------------
@DICOM_CONFIG_CODE@

# The C and C++ flags added to the cmake-configured flags.
set(DICOM_REQUIRED_C_FLAGS "@DICOM_REQUIRED_C_FLAGS@")
set(DICOM_REQUIRED_CXX_FLAGS "@DICOM_REQUIRED_CXX_FLAGS@")

# The version number
set(DICOM_MAJOR_VERSION "@DICOM_MAJOR_VERSION@")
set(DICOM_MINOR_VERSION "@DICOM_MINOR_VERSION@")
set(DICOM_PATCH_VERSION "@DICOM_PATCH_VERSION@")

# Legacy (for backwards compatibility)
set(DICOM_BUILD_VERSION "${DICOM_PATCH_VERSION}")

# Configured settings
set(DICOM_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
set(DICOM_USE_ITK_GDCM "@USE_ITK_GDCM@")
set(DICOM_USE_GDCM "@USE_GDCM@")
set(DICOM_USE_DCMTK "@USE_DCMTK@")
set(DICOM_USE_SQLITE "@USE_SQLITE@")

# Auto-configured settings
set(DICOM_USE_VTKZLIB "@DICOM_USE_VTKZLIB@")

# Dependencies
set(DICOM_VTK_DIR "@VTK_DIR@")
if(NOT VTK_FOUND)
  find_package(VTK PATHS "${DICOM_VTK_DIR}")
else()
  get_filename_component(tmp1 "${DICOM_VTK_DIR}" REALPATH)
  get_filename_component(tmp2 "${VTK_DIR}" REALPATH)
  if(NOT "${tmp1}" STREQUAL "${tmp2}")
    message(WARNING
      "Mismatch for VTK between vtk-dicom and current project: "
      "DICOM_DIR=${DICOM_DIR} "
      "VTK_DICOM_DIR=${DICOM_VTK_DIR} "
      "VTK_DIR=${VTK_DIR}")
  endif()
endif()
if(DICOM_USE_ITK_GDCM)
  set(DICOM_ITK_DIR "@ITK_DIR@")
  if(NOT DICOM_BUILD_SHARED_LIBS AND NOT ITK_FOUND)
    find_package(ITK PATHS "${DICOM_ITK_DIR}")
  endif()
elseif(DICOM_USE_GDCM)
  set(DICOM_GDCM_DIR "@GDCM_DIR@")
  if(NOT DICOM_BUILD_SHARED_LIBS AND NOT GDCM_FOUND)
    find_package(GDCM PATHS "${DICOM_GDCM_DIR}")
  endif()
endif()

# Get the current directory
get_filename_component(DICOM_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

# The location of the "use" file.
set(DICOM_USE_FILE "${DICOM_CMAKE_DIR}/UseDICOM.cmake")

# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET vtkDICOM AND NOT DICOM_BINARY_DIR)
  include("${DICOM_CMAKE_DIR}/DICOMTargets.cmake")
endif()

# Compute paths
set(DICOM_INCLUDE_DIRS "@INCLUDE_DIRS_CONFIG@")
set(DICOM_LIBRARY_DIRS "@LIBRARY_DIRS_CONFIG@")

# These are IMPORTED targets created by DICOMTargets.cmake
set(DICOM_LIBRARIES @DICOM_LIBRARIES@)
